<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <div style='width:600px;height:400px'></div>
  <script src='https://cdnjs.cloudflare.com/ajax/libs/echarts/4.8.0/echarts.min.js'></script>
  <script>
    var xDataArr = ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']
    var yDataArr2 = [3000, 1000, 2000, 2000, 1000, 600, 500, 1300, 1500, 1400, 0, 0]
    var yDataArr = [3000, 4000, 5000, 3106, 3107, 3108, 3100, 3109, 3009, 3001, 3002, 3005]
    var mycharts = echarts.init(document.querySelector('div'))
    var option = {
      title: {
        text: '年度出货量',
        textStyle: {
          color: 'black'
        }
      },
      xAxis: {
        type: 'category',
        data: xDataArr,
        boundaryGap: false
      },
      yAxis: {
        type: 'value',
        scale: true
      },
      series: [
        {
          name: '康师傅方便面',
          data: yDataArr,
          type: 'line',
          markPoint: {
            data: [
              { type: "max" },
              { type: "min" },
            ]
          },
          markLine: {
            data: [
              {
                type: 'average'
              }
            ]
          },
          //第一个图和第二个图stack值要一样
          stack: 'all',
          //设置之后会有区域阴影
          areaStyle: {}
        },
        {
          name: '老毛台方便面',
          type: 'line',
          data: yDataArr2,
          areaStyle: {},
          //第一个图和第二个图stack值要一样
          stack: 'all'
        },
      ],
    }
    mycharts.setOption(option)
  </script>
</body>

</html>